
var express = require("express")

var {expressjwt}=require('express-jwt')

var app = express()

app.use(express.static('static'))

app.use(express.json())
app.use(express.urlencoded({ extended: false }))


app.use( expressjwt({
    secret:'1234',
    algorithms:['HS256'],
}).unless({path:['/api/login','/api/register']}))

var oneRouter=require('./router/oneRouter.js')
//注册子路由
app.use('/api',oneRouter)

app.listen(9090, () => {
    console.log('服务器运行在:http://localhost:9090');
});


